Vue.component('pane', {
    name: 'pane',
    template: '\
		<div :class="paneCls()" v-show="show"> \
			<slot></slot> \
		</div>',
    data: function () {
        return {
            show: true,
			removeIt: false
        }
    },
    props: {
        name: {
            type: String
        },
        label: {
            type: String,
            default: ''
        },
        closabel: {
            type: Boolean,
            default: true
        }
    },
    methods: {
        updateNav() {
            this.$parent.updateNav();
        },
		paneCls(){
			return [
				'pane',
				{
					// 给当前选中的tab加一个class
					'pane-remove': this.removeIt
				}
			]
		}
    },
    watch: {
        label() {
            this.updateNav();
        }
    },
    mounted() {
        this.updateNav();
    }
})
